require "Task/DailyTask/DailyTaskBase"

QNW_TS_SawLogs = QNW_TS_DailyTaskBase:derive("QNW_TS_SawLogs")

local this = QNW_TS_SawLogs
this.name = getText("IGUI_QNW_TaskSystem_Task_SawLogs_Name")
this.desc = getText("IGUI_QNW_TaskSystem_Task_SawLogs_Desc")

function QNW_TS_SawLogs:new()
    local o = QNW_TS_DailyTaskBase:new()
    setmetatable(o, self)
    self.__index = self

    o.maxCount = 1

    return o
end

function QNW_TS_SawLogs:initReward()
    local player = getPlayer()
    local level1 = player:getPerkLevel(Perks.Woodwork)
    if level1 == 10 then
        getText("IGUI_BaoHuFei")
        QNW_TS_ClientCommand.randomReward(self, "medium", 1)
    else
        if ZombRand(4) == 0 then
            getText("IGUI_BaoHuFei")
            QNW_TS_ClientCommand.randomReward(self, "low", 1)
        else
            getText("IGUI_BaoHuFei")
            QNW_TS_ClientCommand.randomReward(self, "low", 1)
        end
    end
end

--黑恶势力任务